package com.gaussian.property.module.biz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gaussian.property.module.biz.entity.ProjectCheckRecord;
import com.gaussian.property.module.biz.mapper.ProjectCheckRecordMapper;
import com.gaussian.property.module.biz.service.IProjectCheckRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 项目打分记录。即每一个估计标准对应的扣分记录 服务实现类
 * </p>
 *
 * @author songqi(13776346982)
 * @since 2024-04-09
 */
@Service
public class ProjectCheckRecordServiceImpl extends ServiceImpl<ProjectCheckRecordMapper, ProjectCheckRecord> implements IProjectCheckRecordService {



    @Override
    public List<ProjectCheckRecord> queryProjectCheckRecord(String projectId, String checkTableId, LocalDateTime startTime, LocalDateTime endTime) {
        LambdaQueryWrapper<ProjectCheckRecord> queryWrapper = new LambdaQueryWrapper<ProjectCheckRecord>()
                .eq(ProjectCheckRecord::getProjectId, projectId)
                .eq(ProjectCheckRecord::getCheckTableId, checkTableId)
                .between(ProjectCheckRecord::getCreateTime, startTime, endTime)
                .orderByDesc(ProjectCheckRecord::getCreateTime);
        return super.list(queryWrapper);
    }

}
